﻿Imports System.Data.DataTableExtensions
Imports System.Data.Sql
Partial Public Class mitglied_uebersicht
    Inherits System.Web.UI.Page
    Private _db As New hc_databaseDataContext
    Private _funktionen As stored_functions_mitglied

    Private Sub gv_Mitguebersicht_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gv_Mitguebersicht.RowDataBound
        If e.Row.RowIndex > -1 Then
            Try
                Dim telefonZelle = e.Row.Cells(3)
                telefonZelle.Text = Replace(telefonZelle.Text, " ", "&nbsp;")
            Catch ex As Exception
            End Try
        End If
    End Sub

    Protected Sub bla(ByVal sender As Object, ByVal e As EventArgs) Handles gv_Mitguebersicht.SelectedIndexChanged, gv_Mitguebersicht.SelectedIndexChanged, gv_Mitguebersicht.SelectedIndexChanged, gv_Mitguebersicht.SelectedIndexChanged
        Dim zellen = gv_Mitguebersicht.SelectedRow.Cells
        Dim mitgliedsID As Int32 = (From it In _db.Mitgliede_Anwaerter _
                                    Where it.Nachname = HttpUtility.HtmlDecode(zellen(1).Text) And _
                                          it.Vorname = HttpUtility.HtmlDecode(zellen(2).Text) And _
                                          it.Email_HC = HttpUtility.HtmlDecode(zellen(4).Text) _
                                    Select it.ID).Single
        Session("MitgliedsID") = mitgliedsID
        Response.Redirect("mitglied_detail.aspx")
    End Sub
End Class